package phapp.service.system.impl;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
import javacommon.base.*;

import phapp.model.system.*;
import phapp.dao.system.*;
import phapp.service.system.impl.*;
import phapp.service.system.*;
/**
* Title: ts_version_info  业务处理层 
* Description: spring事务实现层,调用Dao层取数据
* Copyright: Copyright (c) 2012-10
* Company: 
* 
* @author you name 
* @version 1.0 
*/

@Component("versionManager")
@Transactional
public class VersionManagerImpl extends BaseManager<Version,java.lang.Integer> 
					implements VersionManager {
	
	/**定义Dao*/					
	private VersionDao versionDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
	public void setVersionDao(VersionDao dao) {
		this.versionDao = dao;
	}
	
	/**获取Dao*/	
	public EntityDao getEntityDao() {
		return this.versionDao;
	}
	
	/**
	* <p>分页查询Version<br>
	* @param PageRequest pr
	* @return Page
	* @author 
	*/
	@Transactional(readOnly=true)
	public Page findByPageRequest(PageRequest pr) {
		return versionDao.findByPageRequest(pr);
	}
	
	/**
	* <p>批量删除 Version<br>
	* @param Version u
	* @return Boolean
	* @author 
	*/
	public Boolean  removeByIdArry(Version u) {
		Boolean result =false;
		int i =-1,size=u.getIdList().size();
		i =versionDao.removeByIdArry(u);
		if(i==size){
			result =true;
		}else{
			throw new RuntimeException();
		}
		return result;
	}
	
}
